﻿using Ducu.SRV.ViewModel.Log;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ducu.SRV.ServiceInteface
{
    public interface ILogService
    {
        /// <summary>
        /// invoke this method just do logon, without any other function such as:
        /// check whether the user exist or password is correct
        /// exceptions will be threw if such scenario
        /// </summary>
        /// <param name="model">contain the user's name and password</param>
        /// <param name="days">how many days should the auth cookie will be kept</param>
        void On(OnModel model, int? days);


        /// <summary>
        /// ensure the user name is exist first, else null reference will be threw
        /// </summary>
        /// <param name="model">Log.OnModel</param>
        /// <returns>whether the logon is passed</returns>
        bool HasPassed(OnModel model);

        void Off();
    }
}
